<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>商品类型管理</h2>
	</div>
    <div class="cf">
        <a class="btn" href="{:U('goodsTypeAdd')}">新 增</a>
        <button class="btn ajax-post" target-form="ids" url="{:U('updateGoodsTypeStatus',array('status'=>1))}">启 用</button>
        <button class="btn ajax-post" target-form="ids" url="{:U('updateGoodsTypeStatus',array('status'=>0))}">禁 用</button>
        <button class="btn ajax-post confirm" url="{:U('updateGoodsTypeStatus',array('status'=>-1))}" target-form="ids">删 除</button>
    </div>

    <div class="data-table table-striped">
        <form class="ids">
            <table>
                <thead>
                    <tr>
                        <th class="row-selected">
                            <input class="checkbox check-all" type="checkbox">
                        </th>
                        <th>ID</th>
                        <th>商品类型名称</th>
                        <th>图标</th>
                        <th>属性数量</th>
                        <th>排序</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
		<notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.name|default='无'}</td>
                        <td>
                            <notempty name="vo['icon']">
                                <img src="{$vo.icon|get_cover='path'}" height="20"/> 
                                <else/>
                                无
                            </notempty>
                        </td>
                        <td>{$vo.attribute_num}</td>
                        <td>{$vo.sort}</td>
                        <td>
                            <a title="属性列表" href="{:U('goodsAttributeList?id='.$vo['id'])}">属性列表</a>
                            <a href="{:U('updateGoodsTypeStatus?ids='.$vo['id'].'&status='.abs(1-$vo['status']))}" class="ajax-get">{$vo.status|show_status_op}</a>
                            <a title="编辑" href="{:U('goodsTypeEdit?id='.$vo['id'])}">编辑</a>
                            <a class="confirm ajax-get" title="删除" href="{:U('updateGoodsTypeStatus?ids='.$vo['id'].'&status=-1')}">删除</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
                </tbody>
            </table>
        </form>
        <!-- 分页 -->
        <div class="page">
            {$_page}
        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript">
       highlight_subnav('{:U('goodsTypeList')}');
    </script>
</block>